Optimal. Leaf size=123 \[ -\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} (c-d) f}+\frac {2 \sqrt {d} \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {d} \cos (e+f x)}{\sqrt {c+d} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} (c-d) \sqrt {c+d} f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2859, 2728,
212, 2852, 214} \begin {gather*} \frac {2 \sqrt {d} \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {d} \cos (e+f x)}{\sqrt {c+d} \sqrt {a \sin (e+f x)+a}}\right )}{\sqrt {a} f (c-d) \sqrt {c+d}}-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{\sqrt {a} f (c-d)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 214
Rule 2728
Rule 2852
Rule 2859
Rubi steps
\begin {align*} \int \frac {1}{\sqrt {a+a \sin (e+f x)} (c+d \sin (e+f x))} \, dx &=\frac {\int \frac {1}{\sqrt {a+a \sin (e+f x)}} \, dx}{c-d}-\frac {d \int \frac {\sqrt {a+a \sin (e+f x)}}{c+d \sin (e+f x)} \, dx}{a (c-d)}\\ &=-\frac {2 \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{(c-d) f}+\frac {(2 d) \text {Subst}\left (\int \frac {1}{a c+a d-d x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{(c-d) f}\\ &=-\frac {\sqrt {2} \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} (c-d) f}+\frac {2 \sqrt {d} \tanh ^{-1}\left (\frac {\sqrt {a} \sqrt {d} \cos (e+f x)}{\sqrt {c+d} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} (c-d) \sqrt {c+d} f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 1.30, size = 215, normalized size = 1.75 \begin {gather*} \frac {\left ((2+2 i) (-1)^{3/4} \sqrt {c+d} \tanh ^{-1}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (-1+\tan \left (\frac {1}{4} (e+f x)\right )\right )\right )+\sqrt {d} \left (\log \left (\sec ^2\left (\frac {1}{4} (e+f x)\right ) \left (\sqrt {c+d}+\sqrt {d} \cos \left (\frac {1}{2} (e+f x)\right )-\sqrt {d} \sin \left (\frac {1}{2} (e+f x)\right )\right )\right )-\log \left (\sec ^2\left (\frac {1}{4} (e+f x)\right ) \left (\sqrt {c+d}-\sqrt {d} \cos \left (\frac {1}{2} (e+f x)\right )+\sqrt {d} \sin \left (\frac {1}{2} (e+f x)\right )\right )\right )\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}{(c-d) \sqrt {c+d} f \sqrt {a (1+\sin (e+f x))}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 5.18, size = 131, normalized size = 1.07
method | result | size |
default | \(-\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (-2 d \arctanh \left (\frac {\sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, d}{\sqrt {a \left (c +d \right ) d}}\right ) a^{\frac {3}{2}}+\sqrt {2}\, \arctanh \left (\frac {\sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) a \sqrt {a \left (c +d \right ) d}\right )}{\left (c -d \right ) \sqrt {a \left (c +d \right ) d}\, a^{\frac {3}{2}} \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f}\) | \(131\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 215 vs.
\(2 (104) = 208\).
time = 0.43, size = 727, normalized size = 5.91 \begin {gather*} \left [-\frac {\sqrt {\frac {d}{a c + a d}} \log \left (\frac {d^{2} \cos \left (f x + e\right )^{3} - {\left (6 \, c d + 7 \, d^{2}\right )} \cos \left (f x + e\right )^{2} - c^{2} - 2 \, c d - d^{2} - 4 \, {\left ({\left (c d + d^{2}\right )} \cos \left (f x + e\right )^{2} - c^{2} - 4 \, c d - 3 \, d^{2} - {\left (c^{2} + 3 \, c d + 2 \, d^{2}\right )} \cos \left (f x + e\right ) + {\left (c^{2} + 4 \, c d + 3 \, d^{2} + {\left (c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )\right )} \sqrt {a \sin \left (f x + e\right ) + a} \sqrt {\frac {d}{a c + a d}} - {\left (c^{2} + 8 \, c d + 9 \, d^{2}\right )} \cos \left (f x + e\right ) + {\left (d^{2} \cos \left (f x + e\right )^{2} - c^{2} - 2 \, c d - d^{2} + 2 \, {\left (3 \, c d + 4 \, d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{d^{2} \cos \left (f x + e\right )^{3} + {\left (2 \, c d + d^{2}\right )} \cos \left (f x + e\right )^{2} - c^{2} - 2 \, c d - d^{2} - {\left (c^{2} + d^{2}\right )} \cos \left (f x + e\right ) + {\left (d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \cos \left (f x + e\right ) - c^{2} - 2 \, c d - d^{2}\right )} \sin \left (f x + e\right )}\right ) + \frac {\sqrt {2} \log \left (-\frac {\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) + \frac {2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{\sqrt {a}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right )}{\sqrt {a}}}{2 \, {\left (c - d\right )} f}, \frac {2 \, \sqrt {-\frac {d}{a c + a d}} \arctan \left (\frac {\sqrt {a \sin \left (f x + e\right ) + a} {\left (d \sin \left (f x + e\right ) - c - 2 \, d\right )} \sqrt {-\frac {d}{a c + a d}}}{2 \, d \cos \left (f x + e\right )}\right ) - \frac {\sqrt {2} \log \left (-\frac {\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) + \frac {2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{\sqrt {a}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right )}{\sqrt {a}}}{2 \, {\left (c - d\right )} f}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {1}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )} \left (c + d \sin {\left (e + f x \right )}\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 206, normalized size = 1.67 \begin {gather*} \frac {\sqrt {2} {\left (\frac {2 \, \sqrt {2} d \arctan \left (\frac {\sqrt {2} d \sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-c d - d^{2}}}\right )}{\sqrt {-c d - d^{2}} {\left (c \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) - d \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )\right )}} + \frac {\log \left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{c \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) - d \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} - \frac {\log \left (-\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{c \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) - d \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}\right )}}{2 \, \sqrt {a} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {1}{\sqrt {a+a\,\sin \left (e+f\,x\right )}\,\left (c+d\,\sin \left (e+f\,x\right )\right )} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________